package com.wzy.test;

public class MyFile {
    public String msgName;

    //有参构造
    public MyFile(String msgName) {
        this.msgName = msgName;
    }

    //无参构造
    public MyFile() {

    }
}

class Test {
    public static void main(String[] args) {
        MyFile myFile = new MyFile("helloWorld");
        System.out.println(myFile.msgName);

        MyFile myFile2 = new MyFile();
        myFile2.msgName = "无参构造";
        System.out.println(myFile.msgName);
    }
}
